package com.study.common.entity;


import com.study.common.enumerate.ExceptionInfo;
import com.study.common.exception.MyError;

/**
 * @Author 谭永超 [www.tanyongchao.tk:8090/SumDome/index]
 * @Date 2018/8/22 16:44
 * @Description 自己定义的异常实体类
 */
public class LoginException extends RuntimeException implements MyError {
    // 状态
    private Integer statue;
    // 信息
    private String message;
    // 枚举信息
    private ExceptionInfo exceptionInfo;

    public ExceptionInfo getExceptionInfo() {
        return exceptionInfo;
    }

    public void setExceptionInfo(ExceptionInfo exceptionInfo) {
        this.exceptionInfo = exceptionInfo;
    }

    public Integer getStatue() {
        return statue;
    }

    public void setStatue(Integer statue) {
        this.statue = statue;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public LoginException(ExceptionInfo exceptionInfo) {
        super(exceptionInfo.getMessage());
        this.statue = exceptionInfo.getStatue();
        this.message = exceptionInfo.getMessage();
        this.exceptionInfo = exceptionInfo;
    }
}
